package com.myacg.platform.ui.component.pane;

import java.awt.Color;

import com.myacg.core.entity.Point;
import com.myacg.platform.ui.event.move.BaseLineMoveToEvent;
import com.myacg.platform.ui.event.move.CircularMoveToEvent;
import com.myacg.platform.ui.event.move.ComponentMoveToEvent;
import com.myacg.platform.ui.event.move.LineMoveToEvent;
import com.myacg.platform.ui.event.move.SpringMotionToEvent;
import com.myacg.platform.ui.event.move.SpringbackMoveToEvent;

public class MovePane extends DefaltPane{
	public static final int MOVE_TYPE_LINEMOVE=0;
	public static final int MOVE_TYPE_SPRINGMOTION=1;
	public static final int MOVE_TYPE_SPRINGBACK=2;
	public static final int MOVE_TYPE_Circular=3;
	private   ComponentMoveToEvent moveEvent;
	public MovePane(int width, int height,int  moveType) {
		super(width, height, Color.white);
		//初始化
		init(moveType);
	}
	
	private void init(int  moveType){
		switch (moveType) {
		case MOVE_TYPE_LINEMOVE:
			//加入弹簧移动内核 默认弹簧系数10 
			moveEvent=new LineMoveToEvent(this);
			break;
		case MOVE_TYPE_SPRINGMOTION:
			moveEvent=new SpringMotionToEvent(this);
			break;
		case MOVE_TYPE_SPRINGBACK:
			moveEvent=new SpringbackMoveToEvent(this);
			break;
		case MOVE_TYPE_Circular:
			moveEvent=new CircularMoveToEvent(this);
			break;
		}
	}
	
	
	public void moveTo(Point point,double F,double v0){
		moveEvent.moveTo(point,F,v0);
	}
	//终止移动内核的运转
	public void distoray(){
		moveEvent.distoray();
	}
}
